<? if(!defined('IN_ROOT')) exit('Access Denied'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"><? $user=$this->user; $setting=$this->setting; ?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Manyou's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=MY_CHARSET?>">
<link media="all" type="text/css" href="css/common/admin/admincp.css" rel="stylesheet"/>
<script type="text/javascript">
function check_line(){
var tform = document.modiform;
  	//标题
  	if(tform.title.value==""){
  		alert("线路名称不能为空!");
  		tform.title.focus();
return false;
  	}
  	if (tform.title.value.length > 30){
alert("线路名称不能超过30个字!");
tform.title.focus();
return false;
}

//提前天数
if (tform.earlier_date.value == "" || tform.earlier_date.value == 0){
alert("提前天数不能为空");
tform.earlier_date.focus();
return false;
}
if (tform.earlier_date.value != "" && tform.earlier_date.value >60){
alert("提前天数不能大于60天");
tform.earlier_date.focus();
return false;
}

    //检查出发地
    if(tform.pid[tform.pid.selectedIndex].value == ''){
        alert("请填写出发地!");
        tform.zone.focus();
        return false;  	            
    }
    
    //发团日期
    if (tform.group_date.value == ''){
alert("请填写发团日期");
return false;		  	    
    }
    
    //行程天数
if (tform.daynum.value == "" || tform.daynum.value == 0){
alert("行程天数不能为空");
tform.daynum.focus();
return false;
}
if (tform.daynum.value != "" && tform.daynum.value >30){
alert("行程天数不能大于30天");
tform.daynum.focus();
return false;
}

    //检查交通
    if(tform.traffic.value == ''){
        alert("请填写交通方式!");
        tform.traffic.focus();
        return false;
    }
  	tform.submit();
}
function chg_traffic(){
var tform = document.modiform;

var arr_traffic = ['','飞机','火车','汽车','轮船','动车'];	
var traffic1 = arr_traffic[tform.traffic_1.value];	
var traffic2 = arr_traffic[tform.traffic_2.value];

if (traffic1){
var traffic1_ext = traffic1+'去'
}

if (traffic2){
var traffic2_ext = traffic2+'回'
}
if (traffic1_ext == undefined){
traffic1_ext = '';
}
if (traffic2_ext == undefined){
traffic2_ext = '';
}

tform.traffic.value = traffic1_ext + traffic2_ext;

}
function group_date2_display(i){
if(i==2){
  			document.getElementById('group_date2_span').innerHTML="在下一步价格类型中设置指定日期";
  	}else{
  			document.getElementById('group_date2_span').innerHTML="";
  	}
}
</script>

</head>
<body>
<div id="append">
</div>
<div class="container">

        <? if(isset($message)) { $type=isset($type)?$type:'correctmsg';  ?><div class="<?=$type?>"><p><?=$message?></p></div><? } ?><div class="mainbox nomargin">
<div class="hastabmenu">
                <ul class="tabmenu">
                    <li class="tabcurrent"><a href="index.php?admin_line/edit/<?=$lid?>">第一步：编辑描述</a> </li>
                    <li><a href="index.php?admin_line/editprice/<?=$lid?>">第二步：编辑价格</a></li>
                    <li><a href="index.php?admin_line/editday/<?=$lid?>">第三步：编辑行程</a></li>
                    <li><a href="index.php?admin_line/editdesc/<?=$lid?>">第四步：编辑指南</a></li>
                </ul><div class="tabcontentcur"></div>
        </div>
<form action="index.php?admin_line/edit" method="post" name="modiform" id="modiform" enctype="multipart/form-data">
<table class="opt">
<tr>
<th><font color="Red">*</font>线路名称：</th>
</tr>
<tr>
<td><input class="txt" name="title" value="<?=$d['title']?>" style="width:300px;"></td>
</tr>
<?=$catestr?>
<tr>
<th><font color="Red">*</font>途径景点：</th>
</tr>
<tr>
<td><?=$viewstr?></td>
</tr>
<tr>
<th><font color="Red">*</font>提前天数：</th>
</tr>
<tr>
<td><input id="earlier_date" name="earlier_date" type="text" value="<?=$d['earlier_date']?>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" /><span> 游客须提前报名的天数</span></td>
</tr>
<tr>
<th><font color="Red">*</font>出发城市：</th>
</tr>
<tr>
<td><?=$area_js?></td>
</tr>
<tr>
<th><font color="Red">*</font>发团日期：</th>
</tr>
<tr>
<td><input type="radio" class="radio" name="group_date" value="1" onclick="group_date2_display(1);"<? if($d['group_date']==1) { ?> checked<? } ?>/>天天发团</label> <label><input type="radio" class="radio" name="group_date" value="2"  checked onclick="group_date2_display(2);" <? if($d['group_date']==2) { ?> checked<? } ?>/>指定日期</label>&nbsp;&nbsp;<span id="group_date2_span" class="c_808080"></span></td>
</tr>
<tr>
<th><font color="Red">*</font>行程天数：</th>
</tr>
<tr>
<td><input id="daynum" name="daynum" type="text" value="<?=$d['daynum']?>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" /></td>
</tr>
<tr>
<th><font color="Red">*</font>交通方式：</th>
</tr>
<tr>
<td><select name="traffic_1" onchange="chg_traffic()">
      <option value="0">请选择</option>
      <option value="1">飞机</option><option selected value="2">火车</option><option value="3">汽车</option><option value="4">轮船</option><option value="5">动车</option>      </select>去
        <select name="traffic_2" onchange="chg_traffic()">
          <option value="0">请选择</option>
          <option value="1">飞机</option><option selected value="2">火车</option><option value="3">汽车</option><option value="4">轮船</option><option value="5">动车</option>        </select>回&nbsp;  
       <input name="traffic" type="text" value="<?=$d['traffic']?>"/><span class="c_808080"> 往返交通或行程包含的交通方式</span></td>
</tr>
<tr>
<th>线路描述图：</th>
</tr>
<tr>
<td><input id="idFile" type="file" name="imgurl"/>
</td>
</tr>
<tr>
<th>排序：</th>
</tr>
<tr>
<td><input name="orderid" type="text" value="<?=$d['orderid']?>" /> <span class="c_808080">数字越小排越前，仅对网店有效</span></td>
</tr>
<tr>
<th>是否显示：</th>
</tr>
<tr>
<td><label><input name="isrec" type="radio" value="1"  <? if($d['isrec']==1) { ?> checked<? } ?>/>显示</label>
<label><input name="isrec" type="radio" class="radio" value="0"  <? if($d['isrec']==0) { ?> checked<? } ?>/>隐藏</label> 
</td>
</tr>
<tr>
<th>跳转：</th>
</tr>
<tr>
<td><input type="radio" value="1" name="tz">继续编辑&nbsp;<input type="radio" value="2" name="tz" checked>跳到列表&nbsp;<input type="radio" value="2" name="tz">编辑价格
</td>
</tr>
</table>
<div class="opt">
<input class="btn" tabindex="3" type="button" onclick="check_line();" value=" 确定编辑 "></div>
<input type="hidden" value="<?=$d['uid']?>" name="uid" />
<input type="hidden" value="<?=$lid?>" name="lid" />
</form>
</div>
</div>

</body>

</html>
